<html>
<head>
    <title>Title</title>
	<script type="text/javascript" src="jquery.min.js"></script>
</head>
<body>
        邮箱：<input type="text" name="email" value="470922596@qq.com">
        密码：<input type="password" name="password" value="123456">
        <input type="button" value="登录" onclick="login()">
		<input type="button" value="注册" onclick="register()">
    
</body>

<script>

function register(){
	window.location.href = "http://localhost/static/register.html";
}

function login(){
	var email = $("input[name='email']").val();
	var password = $("input[name='password']").val();
	$.ajax({
		url: 'http://localhost/api/user/login/'+email+'/'+password,
		type: 'get',
		contentType: 'application/json;charset=utf-8',
		dataType: 'json',
		success: function (data) {
			console.log(data);
			if(data.status){
				window.location.href = "http://localhost/static/welcome.html";
			}else{
				alert(data.msg);
			}
		}
	})
}
</script>

</html>